The term “virtual memory” (or virtual storage) denotes the simulation of a uniformly addressable computational memory large enough to accommodate all instantiations of a program on all configurations of a computer system. Virtual memory originated as a way to simplify application programming in machines with memory hierarchies. With virtual memory, application programmers no longer had to include commands to move blocks of information among the levels of the memory hierarchy as the operating system manages the application's virtual memory.
Virtual memory is also being incorporated into parallel processing computer systems that may include hundreds or even thousands of computers (each with a processor and local RAM), hooked together by an interconnection network. The virtual addressing concept is being extended to map a single, common virtual address space across distributed systems. Its uniform addressing scheme allows any processor to refer to any data element in any of the component computers' memories. The memory access algorithm scales across many sizes of computer systems. Thus, virtual memory also hides distributed memory.
The key to virtual memory is a uniform address format and addressing protocol that is independent of the sizes of memory levels and the number of computing elements. Virtual address space is the programmer's view of memory. Typically, the virtual address space contains 2A words (or bytes) on a machine whose processors use A-bit virtual addresses. The entire set of addresses supported by the 2200 computer system commercially available from Unisys Corporation is called the “absolute address space” of the system. The absolute address space is often much larger than the virtual address space. The absolute address space holds all programs and data which are spread across the various virtual address spaces visible to different programs or threads of control. The set of addresses recognized by the hardware is called the “real address space” of the machine. The real address space is bound by the physical constraints of the memory size. The real address space contains 2B words on a machine with B-bit addresses. While some computer architectures utilize a three-level memory hierarchy of virtual, absolute, and real addresses as discussed above, most utilize a two-level memory hierarchy of virtual and linear addresses.
The virtual address space does not have to be the same size as the real address space. If it is smaller, RAM typically holds several address spaces and the virtual memory system implements multiprogramming. If it is larger, the virtual memory system typically automatically moves information from a backing store into RAM as needed, to simulate the appearance that the whole address space is available to a program in RAM. Even if it is larger, the same RAM can be partitioned among several address spaces, again implementing multiprogramming.
The mapping from processor-generated addresses to memory-recognizable addresses is often carried out by a dynamic address translator. When the program generates a read access request, for example, the processor address translator presents a read request to the memory system, and passes back the value read to the processor and thus to the program. Similarly, when the program generates a write access request, the processor address translator presents the write to the memory system. This design makes address translation transparent to the computer programmer. The program view of addressing invariance with respect to changes in the machine's configuration or the distribution of data among memory elements in the memory hierarchy is achieved by allowing the operating system to change the mapping tables during a program's execution, thereby reflecting the system state dynamically during the mapping operation, rather than in the program itself.
As software systems become more and more complex, there is an increasing demand for more storage. The size of the virtual address is typically only limited by the addressing scheme of the computer system and is the amount of auxiliary storage available, and not by the number of main storage locations. Due to the mapping of virtual addresses into real addresses, virtual addresses storage systems are often able to satisfy the ever increasing demand for storage in a manner that is transparent to the user who may regard all the storage space as addressable main storage.
The translation of virtual addresses into physical addresses that can be used to access memory is often accomplished by dividing the virtual addressing space into fixed size segments referred to as “pages”, which are analogous to the data portions of the records in a data base. The virtual address space is divided into pages, and page table entries are used to designate those pages which are currently resident in main, or real, memory. The classical method of accomplishing this is to select part of the virtual address as an index. Another portion of the virtual address is selected as a comparison segment. The remaining bits of the virtual address then serve as the in-page, or offset, address into the page. The combined index and comparison portions of the virtual address are analogous to the key portion of a record in a data base system.
To access the page table entries, a number of least significant bits (for example, 12) can be used as the offset into the page and the next N significant bits may be used to index into the page table. When used in this fashion, the operation is referred to as “hashing”, and the page table is also termed a hash table. The entries into the hash table can initiate a number of chains of page table entries all of which have the same value of N bits (e.g. synonyms). Each of the entries contains the remaining bits of the virtual address that it represents, and the value of N is determined by the hardware and software that is utilized to implement the algorithm.
In operation of this system, the instruction processor goes to the hash entry that is specified by these N bits and locates a chain of all pages whose virtual addresses include the same value of the N bits. The instruction processor then progresses through the chain from one page entry to the next, and at each entry compares the comparison portion of the virtual address to be located with a stored comparison portion of the page table entry until a match is obtained. Once a match is obtained, the real page address is retrieved from the entry, and then concatenated with the page offset to form the complete real address. In the event that the instruction processor does not find a match in the chain, (i.e., there is no entry containing the value of the comparison portion), the page is not resident in real memory.
A more detailed description of a prior art technique for address hashing is shown in FIG. 1. Paging techniques have been utilized to access memory in virtual memory systems through the use of key fields. For example, and referring to FIG. 1, in such systems virtual address requests 10, 12 may be used to map large virtual addresses into comparatively small real address space. This has been accomplished by dividing the virtual addresses into compare, index (or key), and offset segments. The index, or key, portions 14, 16 of the virtual addresses 10, 12 are used to reference memory locations in a page table 32. The compare portions 18, 20 of the virtual addresses 10, 12 represent values, each of which may be associated with a number of page table entries. The page offsets 22, 24 of the virtual addresses 10, 12 represent the offset location of the requested address in a page, which may be utilized along with an appropriate real page address 36 to obtain a real address 28. Since only the index portions 14, 16 of the virtual addresses 10, 12 are utilized to select page table entry 34, auxiliary techniques must typically be employed to resolve conflicts among non-unique index portions in a paged virtual memory system of the described type. One such technique previously mentioned is the chaining method.
When prior art virtual memory systems incorporate tables, such as the page table 32, the value of the index 14 of the virtual address 10 may be used to locate the desired page table entry 34 in the page table 32. The page table entry 32 includes a specified real page address 36 and a compare segment 38. A second virtual address 12 can also be used to locate a second entry in the same page table 32, wherein its index value 16 may be the same as index value 14, providing there is no conflict between the values of the compare segments 18 and 20. FIG. 1 illustrates a prior art implementation in which index 14 and index 16 both point to the same page table entry 34. Because of this possibility of encountering non-unique index values, it is necessary to look at the compare portion 38 of the page table entry 34, and to compare this with the compare portions 18, 20 of the virtual addresses 10 and 12, respectively. Although FIG. 1 implies that this comparison takes place in a simultaneous manner, sequential comparison of the compare segment 18 with the compare segment 38, either followed, or preceded, by comparison of the compare segment 20 with the compare segment 38, is consistent with prior art implementations. This comparison may be achieved by use of either a hardware comparator, or through a software algorithm, either of which may be achieved in various ways now known to those skilled in the art. It is assumed in this description that a comparison match occurs between the compare segment 18 and compare segment 38, but that no match occurs between the compare segment 20 and the compare segment 38.
The values of compare segment 18 of virtual address 10 and of the compare segment 38 of the page table entry 34 are coupled to a comparison device, or step, 40, as represented by the line 42 and the lines 43, 44. In a hardware implementation, these lines each represent signal-carrying data lines. In a software implementation, they represent program data flow. The comparison check provided by the comparison device or step 40 thus indicates a match on the lines 46, 48, which are coupled to enable the enabling gates, or steps, 50, 52, respectively, which may be achieved through either hardware or software implementation.
If the compare segments 18 and 38 are equal, the enabling gate 50 couples the offset segment 22 of the virtual address 10, as indicated by the lines 49 and 51, to serve as the least significant bits, or offset 26 of the real address 28. Likewise, the real page address 36 of the page table entry 34 is coupled, as represented by the lines 54 and 56 through the gate 52, to serve as the most significant bits portion 30 of the real address 28. The real page address 30 is combined with the offset portion 26 to form the total real address 28.
The comparison device, or step, 58, as the case may be according to whether implementation is accomplished through hardware or software, represents a comparison of the compare segment 20 of the virtual address 12, with the compare segment 38 of the page table entry 34. The values of the compare segment 20 and of the compare segment 38 are coupled to the comparison device, or step, 58 for such comparison as represented by the line 60 and the lines 43, 45. The lines 60, 43, 45, like the lines 42, 43, 45, may represent either data lines or program data flow according to whether a hardware or software implementation is undertaken. In the illustrated embodiment, it is assumed that although index 14 and index 16 are equal, the values in compare segments 18 and 20 are not. Since the page table can contain only one page table entry which has a given index value, the page table entry 34 corresponds only to virtual address 10 and not to virtual address 12. This being the case, the comparison device, or step, 58 will indicate that there is no comparison for virtual address 12, and, as indicated by the output on the line 64 to the mass memory access 66, it will then be necessary to obtain the contents of virtual address 12 from mass storage since it will not be resident in the main memory. The complete virtual address 12 is supplied, as indicated by the line 68, to active mass memory access 66 so that it may be used to supply, as indicated by the line 70, data stored at the desired location in backing storage, since in the illustrated Figure it is assumed that the compare segment 20 does not match the compare segment 38.
In other words, FIG. 1 does not illustrate the conflict case where both virtual addresses 10, 12 are present in main memory. If both of the virtual addresses are present in main memory, a conflict mechanism must be called to resolve the ambiguity. As previously noted, this is typically accomplished by searching an extended chain of page table entries, each of which point to another element in the chain, until the search terminates either by locating the desired real address, or by providing a “page fault” that indicates that the virtual address is not resident in main memory.
In order to provide a relatively large linear address space for today's user applications, the operating system often loads the application into the absolute address space and reserves a relatively large area of contiguous absolute address space following the load area. This gives each user application the ability to dynamically expand its address space. In order to accomplish this, the absolute address linear space can be much larger such as 262,144 times larger them the available real address space. Despite this, storage pages are typically created for each of the absolute addresses that are reserved by the operating system.
The operating system typically uses a second level of memory management to map the absolute address pages to real addresses. The operating system often performs the management of the page tables as well as converting I/O addresses from absolute to real addresses. A typical paging system involves a backing store file that contains all of the allocated storage pages, with a subset of the pages on the backing store loaded into main store pages as needed.
A limitation of such systems is that in many cases only a relatively small number of the absolute addresses are actually used by the user applications running on a system. Therefore, such schemes can often result in an inefficient use of resources, which can reduce the capacity and/or performance of the system. In some cases, a user application may have to access the backing store even though some of the locations in main memory are unused by another user application. This can significantly reduce the performance of the system.